import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue()],
  server: {
    proxy: {
      '/api': {
        // target: 'http://10.0.3.54:8888/', // 实际请求地址 yqz
        // target: 'http://10.0.3.41:8888/', // xly
        target: 'http://127.0.0.1:8000/', // me
        // target: "http://192.168.43.221:8888/", // xly热点
        // target: 'http://192.168.43.23:8888/', // yqz热点
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
      '/ws': {
        target: 'ws://127.0.0.1:8000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/ws/, ""),
        ws: true
      }
    },
    // host: "10.0.3.25"
    // host: '192.168.43.80',
    // host: "192.168.50.4"
  }
})
